﻿@model IEnumerable<SmallJob.Model.Request>
@{
    var cul = System.Globalization.CultureInfo.GetCultureInfo("vi-VN");
    var temp = DateTime.Now;
    var now = new DateTime(temp.Year, temp.Month, temp.Day, 0, 0, 0);
    var continueurl = ViewData["continueurl"] as String;
}
@foreach (var item in Model)
{
    <div class="request-detail-container">
        <div class="request-detail-toparea row-fluuid">
            <div class="request-detail-title span9">
                <a href="@Url.Action("Details", new { id = item.ID })">@SmallJob.Services.Code.UserUtility.ShortString(item.Title, "100")
                </a>

            </div>
            <div class="request-detail-price span3"><strong>@item.Price.ToString("#,###", cul.NumberFormat)  VNĐ</strong></div>
        </div>
        <div class="request-detail-midarea row-fluid">
            <p> @(SmallJob.Services.Code.UserUtility.ShortString(SmallJob.Services.Code.UserUtility.RemoveHtml(HttpUtility.HtmlDecode(item.Description)), "200")) - <em><a href="/@(string.IsNullOrWhiteSpace(item.AssignedUser.UserName) ? item.AssignedUser.ID.ToString() : item.AssignedUser.UserName)">@item.AssignedUser.ProperName</a></em>
            </p>
			<div style="float: left"><a href="@Url.Action("Details", new { id = item.ID })">Chi tiết</a></div>
			<div style="float: right">@(item.EndDate == now ? "Hôm nay" : item.EndDate.ToString("dd-MM-yyyy"))</div>
        </div>
    </div>
}
<div class="request-detail-paging pagination">
    <ul>
        @{
            var total = Convert.ToInt32(ViewData["total"]);
            var curpage = Convert.ToInt32(ViewData["curpage"]);
            if (curpage > 1)
            {
@*<li><a href="javascript:;" onclick="triggerpagefilter(this);" id="linkpage-@(curpage - 1)">Prev</a></li>*@
            <li><a href="/Request/Show?page=@((curpage - 1) + continueurl)">Trang trước</a></li>
            }
            for (int i = 1; i <= total; i++)
            {
                if (i != curpage)
                {
            <li><a href="/Request/Show?page=@(i + continueurl)">@i</a></li>
                }
                else
                {
            <li><a href="/Request/Show?page=@(i + continueurl)"><strong>@i</strong></a></li>
                }
            }
            if (curpage < total)
            {
            <li><a href="/Request/Show?page=@((curpage + 1) + continueurl)">Trang sau</a></li>
            }
        }
    </ul>
</div>
